<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta content="black" name="apple-mobile-web-app-status-bar-style">
        <title>订单详情</title>
        <script src="__JS__/zepto.min.js"></script>
        <link href="__CSS__/weui.min.css" rel="stylesheet">
        <link rel="stylesheet" href="__SALEMAN__/stylesheets/index.css">
    </head>
    <body>
        <div class="orderInfo">
            <header class = "all_header">
                <a class = "h_back h_back_1" href="/Home/Saleman/Saleman/myorder"><img src="__SALEMAN__/images/back_icon.png" alt=""></a>
                <span class = "h_title">订单详情</span>
                <a class = "h_add" href="javascript:void(0);"></a>
            </header>
            <div class="order">
                <div class="order_adress">
                    订单地址<br/>
                    &nbsp;&nbsp<span>{$return['address']}</span>
                </div>
                <volist name="lists" id="data">
                    <div class="order_list">
                       
                        <div class="order_price_w">
                            <span class = "order_w">药品名称</span>
                            <span>{$data['drugs_name']}</span>
                        </div>
                        <div class="order_price_w">
                            <span class = "order_w">药品数量</span>
                            <span>{$data['num']}</span>
                        </div>
                         <div class="order_price_w">
                            <span class = "order_w">药品单价</span>
                            <span>{$data['price']}</span>
                        </div>
                        
                        <div  style="border-bottom:1px solid #ccc;border-top:">
                            <span class = "order_w">总价</span>
                            <span>¥<i class = "all_num">{$data['total_price']}</i></span>

                        </div>
                        
               </div>
                </volist>
               
            </div>
            <if condition="$return['status'] eq 0">
           <div class="weui-btn-area" style="width:500px;height:50px">
               <span style="float:left" class="btn"> <a class="weui-btn total_btn btn_status" href="javascript:" pos_title="如果选择'完成'就等于确定已收到货品" pos_id="{$return['id']}" pos_status="1">完成</a></span>&nbsp;&nbsp;
               
               
               <span style="float:left;margin-left:30px" class="btn"> <a class="weui-btn total_btn btn_status" href="javascript:" pos_title="确定此订单退货？" pos_id="{$return['id']}" pos_status="2">退货</a></span>
                
               </div>
               <elseif condition="$return['status'] eq 1"/>
                <span style="float:left;margin-left:30px" class="btn"> <a class="weui-btn total_btn btn_status" href="javascript:" pos_title="确定此订单退货？" pos_id="{$return['id']}" pos_status="2">退货</a></span>
               </if>


        </div>

    <include file="./Application/Home/View/default/Saleman/Public/popup.html"/>
      <script src = "__SaleManager__/js/androidback.js"></script>
    <script src = "__SALEMAN__/js/index.js"></script>
  
    <script>
    var that;
    $('.weui-btn').on('click', function () {
            var title = $(this).attr('pos_title');
            $('.confir_content').html(title);
            $("#iosDialog1").show(200);
            that= $(this);
        });

        $(".ok-btn").click(function(){
               
            var proj_id = that.attr("pos_id");
            var status = that.attr("pos_status");
            $.ajax({
                 url: "/Home/Saleman/Saleman/order_status",
                type: 'post',
                data: {id: proj_id, status: status},
                cache: false,
                dataType: "json",
                success: function (result) {
                 
                   
                    $("#iosDialog1").hide(200);
                            $('#iosDialog2').find('.sure-info').html(result['msg']);
                            
                           $('#iosDialog2').show(200);
                            
                            $(".weui-dialog__btn_primary").click(function(){
                                
                             window.location.href="/Home/Saleman/Saleman/myorder";

                            })
                }
            })
        })
    </script>
</body>
</html>